package com.ruoyi.web.controller.honor.studenttypicality;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.honor.student.GraduateStudent;
import com.ruoyi.system.domain.honor.student.GraduateStudentEducation;
import com.ruoyi.system.domain.honor.student.GraduateStudentVo;
import com.ruoyi.system.domain.honor.studenttypicality.TypicalityStudent;
import com.ruoyi.system.service.honor.IStudentTypicalityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 代性毕业生信息Controller
 *
 * @author ruoyi
 * @date 2025-08-01
 */
@RestController
@RequestMapping("/honor/studenttypicality")
public class StudentTypicalityController extends BaseController
{
    @Autowired
    private IStudentTypicalityService graduateStudentService;

    /**
     * 查询代性毕业生信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(TypicalityStudent graduateStudent)
    {
        startPage();
        List<TypicalityStudent> list = graduateStudentService.selectGraduateStudentList(graduateStudent);
        return getDataTable(list);
    }



    /**
     * 获取代性毕业生信息详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(graduateStudentService.selectGraduateStudentById(id));
    }

    /**
     * 新增代性毕业生信息
     */
    @Log(title = "代性毕业生信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TypicalityStudent graduateStudent)
    {
        return toAjax(graduateStudentService.insertGraduateStudent(graduateStudent));
    }

    /**
     * 修改代性毕业生信息
     */
    @Log(title = "代性毕业生信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TypicalityStudent graduateStudent)
    {
        return toAjax(graduateStudentService.updateGraduateStudent(graduateStudent));
    }

    /**
     * 删除代性毕业生信息
     */
    @Log(title = "代性毕业生信息", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(graduateStudentService.deleteGraduateStudentByIds(ids));
    }
}
